package com.zts.base.exception;

import org.springframework.context.MessageSource;
import org.springframework.http.HttpStatus;
import org.springframework.web.bind.annotation.ResponseStatus;

/**
 * Created by Zhangkh on 2017/6/1.
 */
@ResponseStatus(HttpStatus.BAD_REQUEST)
public class InvalidArgumentException extends ServiceException {
    private static final String DEFAULT_CODE = CommonExceptionCode.PARAM_ILLEGAL;

    public InvalidArgumentException() {
        setCode(DEFAULT_CODE);
    }

    public InvalidArgumentException(String message, Object... args) {
        super(message, args);
        setCode(DEFAULT_CODE);
    }

    public InvalidArgumentException(Throwable cause) {
        super(cause, DEFAULT_CODE);
        setCode(DEFAULT_CODE);
    }

    public InvalidArgumentException(Throwable cause, String message, Object... args) {
        super(cause, message, args);
        setCode(DEFAULT_CODE);
    }

    public InvalidArgumentException(MessageSource messageSource, String code, Object... args) {
        super(messageSource, code, args);
    }

    public InvalidArgumentException(Throwable cause, MessageSource messageSource, String code, Object... args) {
        super(cause, messageSource, code, args);
    }
}